<?php
class address{
    
    public function __construct() {
        $args = func_get_args();
    }
    
    function getSubDistrict($subDistrictID){
        $mysqli=  connect();
        $query="
            select  *
            from    thai_subdistrict
            where   subDistrictID='".$subDistrictID."'
            ";
        $result=$mysqli->query($query);
        return $result->fetch_array(MYSQLI_ASSOC);
    }
    function getDistrict($districtID){
        $mysqli=  connect();
        $query="
            select  *
            from    thai_district
            where   districtID='".$districtID."'
            ";
        $result=$mysqli->query($query);
        return $result->fetch_array(MYSQLI_ASSOC);
    }
    function getProvince($provinceID){
        $mysqli=  connect();
        $query="
            select  *
            from    thai_province
            where   provinceID='".$provinceID."'
            ";
        $result=$mysqli->query($query);
        return $result->fetch_array(MYSQLI_ASSOC);
    }
}